/**
 * Created by zhaoy on 2016/4/11.
 * Message 针对sweet alert不兼容IE的情况
 */



function layerAlert(text) {
    if(typeof swal == "undefined"){
        layer.alert(text, {
            icon: 2,
            skin: 'layer-ext-moon'
        })
    }else{
        swal({
            title: "错误",
            text: text,
            type: "error",
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "确定",
            cancelButtonText : '取消'
        });
    }
}

function layerConfirm(text, option, success) {
    if(typeof swal == "undefined"){
        layer.confirm(text, {
            btn: ['确定','取消'] //按钮
        }, success);
    }else{
        swal({
            title: "确认操作",
            text: text,
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "确定",
            cancelButtonText : '取消',
            closeOnConfirm: true
        }, success);
    }

}

function layerMsg(text) {

    if(typeof swal == "undefined"){
        layer.msg(text);
    }else{
        swal("提示", text, "success");
    }
}


